<template>
	<el-scrollbar height="500px">
		<el-form

			label-width="auto"
			:model="formData"
			:size="'small'"
			style="max-width: 300px;"
		>
			<el-form-item label="姓名" >
				<el-input v-model="formData.name" />
			</el-form-item>
			<el-form-item label="民族" >
				<el-input v-model="formData.nation" />
			</el-form-item>
			<el-form-item label="手机号" >
				: {{ formData.phoneNum }}
			</el-form-item>
			<el-form-item label="身份证号" >
				<el-input v-model="formData.idNum" />
			</el-form-item>
			<el-form-item label="收入" >
				<el-input v-model="formData.income" />
			</el-form-item>
			<el-form-item label="学历" >
				<el-input v-model="formData.education" />
			</el-form-item>
			<el-form-item label="地址" >
				<el-input v-model="formData.address" />
			</el-form-item>
			<el-form-item label="职业" >
				<el-input v-model="formData.career" />
			</el-form-item>
			<el-form-item label="车辆资产" >
				<el-input v-model="formData.cars"/>
			</el-form-item>
			<!--<el-form-item label="当前地址居住时间" >-->
			<!--	<el-input v-model="formData.addressTime" />-->
			<!--</el-form-item>-->
			<!--<el-form-item label="当前地址是否为所租房屋" prop="resource">-->
			<!--	<el-radio-group v-model="formData.is">-->
			<!--		<el-radio value="true">是</el-radio>-->
			<!--		<el-radio value="false">不是</el-radio>-->
			<!--	</el-radio-group>-->
			<!--</el-form-item>-->
			<!--<el-form-item label="一年内使用手机号码的个数" >-->
			<!--	<el-input v-model.number="formData.phoneNum" />-->
			<!--</el-form-item>-->
			<!--<el-form-item label="当前手机号码使用时间" >-->
			<!--	<el-input v-model="formData.phoneTime" />-->
			<!--</el-form-item>-->
			<el-form-item label="房屋信息" >
				<el-input v-model="formData.houseProperty" />
			</el-form-item>
			<!--<el-form-item label="借款产品类型" >-->
			<!--	<el-input v-model="formData.loanType" />-->
			<!--</el-form-item>-->
			<el-form-item >
				<el-button type="primary" @click="handleSubmit">更新信息</el-button>
			</el-form-item>
		</el-form>
	</el-scrollbar>
</template>

<script lang="js" setup>
import {onMounted, ref} from 'vue'
import {getRespondentById, updateRespondent} from "@/axios/respondent/respondentReq";
import {ElMessage} from "element-plus";
import useRespondentStore from "@/stores/respondent";

const respondentStore = useRespondentStore()
const formData = ref({})

onMounted(()=>{

	getRespondentById(respondentStore.id).then(res=>{
		Object.assign(formData.value, res)
	})

})
const handleSubmit = () => {
	updateRespondent(formData.value).then(()=>{
		ElMessage.success('更新成功')
	})
}
</script>

<style scoped lang="css" >


</style>